home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996…tember: Reference Library / Dev.CD Sep 96 RL / Dev.CD Sep 96 RL.toast / mac / Technical Documentation / develop / develop Issue 1 / develop Issue 1 code / Compatibility.sea / Compatibility / Printing / PRSave.c < prev    next >
MacBinary  |  1989-12-11  |  9.5 KB  |  [TEXT/MPS ]

open in: MacOS 8.1     |     Win98     |     DOS

browse contents    |     view JSON data     |     view as text


This file was processed as: MacBinary (archive/macBinary).

ConfidenceProgramDetectionMatch TypeSupport
66% dexvert Compact Compressed (Unix) (archive/compact) ext Supported
1% dexvert MacBinary (archive/macBinary) fallback Supported
1% dexvert Text File (text/txt) fallback Supported
100% file MacBinary II, inited, Mon Dec 11 01:38:13 1989, modified Mon Dec 11 01:38:13 1989, creator 'MPS ', type ASCII, 8916 bytes "PRSave.c" , at 0x2354 536 bytes resource default (weak)
99% file data default
74% TrID Macintosh plain text (MacBinary) default
25% TrID MacBinary 2 default (weak)
100% dearkID deark: macbinary default
100% siegfried fmt/1762 MacBinary (II) default
100% lsar MacBinary default


id metadata
keyvalue
macFileType[TEXT]
macFileCreator[MPS ]



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 00 08 50 52 53 61 76 65 | 2e 63 00 00 00 00 00 00 |..PRSave|.c......|
|00000010| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000040| 00 54 45 58 54 4d 50 53 | 20 01 00 00 00 00 00 00 |.TEXTMPS| .......|
|00000050| 00 00 00 00 00 22 d4 00 | 00 02 18 a1 a8 fb d5 a1 |....."..|........|
|00000060| a8 fb d5 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000070| 00 00 00 00 00 00 00 00 | 00 00 81 81 78 da 00 00 |........|....x...|
|00000080| 2f 2a 20 50 72 53 61 76 | 65 2e 63 09 09 09 09 09 |/* PrSav|e.c.....|
|00000090| 09 09 09 09 09 09 09 09 | 09 09 09 09 09 09 2a 2f |........|......*/|
|000000a0| 0d 2f 2a 09 09 09 09 09 | 09 09 09 09 09 09 09 09 |./*.....|........|
|000000b0| 09 09 09 09 09 09 09 09 | 2a 2f 0d 2f 2a 09 54 68 |........|*/./*.Th|
|000000c0| 69 73 20 69 73 20 61 6e | 20 65 78 61 6d 70 6c 65 |is is an| example|
|000000d0| 20 6f 66 20 73 61 76 69 | 6e 67 20 61 20 70 72 69 | of savi|ng a pri|
|000000e0| 6e 74 20 72 65 63 6f 72 | 64 20 69 6e 74 6f 20 61 |nt recor|d into a|
|000000f0| 20 72 65 73 6f 75 72 63 | 65 20 66 69 6c 65 2e 20 | resourc|e file. |
|00000100| 20 53 61 76 69 6e 67 20 | 74 68 65 09 2a 2f 0d 2f | Saving |the.*/./|
|00000110| 2a 20 70 72 69 6e 74 20 | 72 65 63 6f 72 64 20 69 |* print |record i|
|00000120| 6e 20 64 6f 63 75 6d 65 | 6e 74 20 72 65 73 6f 75 |n docume|nt resou|
|00000130| 72 63 65 20 66 69 6c 65 | 73 20 70 72 6f 76 69 64 |rce file|s provid|
|00000140| 65 73 20 61 20 6d 65 74 | 68 6f 64 20 6f 66 20 72 |es a met|hod of r|
|00000150| 65 74 61 69 6e 69 6e 67 | 20 74 68 65 20 75 73 65 |etaining| the use|
|00000160| 72 09 2a 2f 0d 2f 2a 20 | 73 65 74 74 69 6e 67 20 |r.*/./* |setting |
|00000170| 66 72 6f 6d 20 74 68 65 | 20 6c 61 73 74 20 70 72 |from the| last pr|
|00000180| 69 6e 74 20 6a 6f 62 2e | 20 20 46 6f 72 20 65 78 |int job.| For ex|
|00000190| 61 6d 70 6c 65 2c 20 69 | 66 20 61 20 75 73 65 72 |ample, i|f a user|
|000001a0| 20 65 6c 65 63 74 73 20 | 74 6f 20 70 72 69 6e 74 | elects |to print|
|000001b0| 20 61 20 09 09 2a 2f 0d | 2f 2a 20 64 6f 63 75 6d | a ..*/.|/* docum|
|000001c0| 65 6e 74 20 75 73 69 6e | 67 20 6c 61 6e 64 73 63 |ent usin|g landsc|
|000001d0| 61 70 65 20 6f 72 69 65 | 6e 74 61 74 69 6f 6e 2c |ape orie|ntation,|
|000001e0| 20 74 68 61 74 20 69 6e | 66 6f 72 6d 61 74 69 6f | that in|formatio|
|000001f0| 6e 20 69 73 20 73 74 6f | 72 65 64 20 69 6e 20 74 |n is sto|red in t|
|00000200| 68 65 20 70 72 69 6e 74 | 09 2a 2f 0d 2f 2a 20 72 |he print|.*/./* r|
|00000210| 65 63 6f 72 64 2e 20 20 | 49 66 20 74 68 65 20 72 |ecord. |If the r|
|00000220| 65 63 6f 72 64 20 69 73 | 20 73 61 76 65 64 20 77 |ecord is| saved w|
|00000230| 69 74 68 20 74 68 65 20 | 64 6f 63 75 6d 65 6e 74 |ith the |document|
|00000240| 2c 20 74 68 65 20 6f 72 | 69 65 6e 74 61 74 69 6f |, the or|ientatio|
|00000250| 6e 20 69 6e 66 6f 72 6d | 61 74 69 6f 6e 09 2a 2f |n inform|ation.*/|
|00000260| 0d 2f 2a 20 77 69 6c 6c | 20 62 65 20 61 76 61 69 |./* will| be avai|
|00000270| 6c 61 62 6c 65 20 66 6f | 72 20 74 68 65 20 6e 65 |lable fo|r the ne|
|00000280| 78 74 20 74 69 6d 65 20 | 74 68 65 20 64 6f 63 75 |xt time |the docu|
|00000290| 6d 65 6e 74 20 69 73 20 | 70 72 69 6e 74 65 64 2e |ment is |printed.|
|000002a0| 20 20 57 68 65 6e 20 74 | 68 65 20 27 50 61 67 65 | When t|he 'Page|
|000002b0| 09 09 2a 2f 0d 2f 2a 20 | 53 65 74 75 70 27 20 64 |..*/./* |Setup' d|
|000002c0| 69 61 6c 6f 67 20 69 73 | 20 70 72 65 73 65 6e 74 |ialog is| present|
|000002d0| 65 64 2c 20 74 68 65 20 | 75 73 65 72 27 73 20 63 |ed, the |user's c|
|000002e0| 68 6f 69 63 65 73 20 66 | 72 6f 6d 20 74 68 65 20 |hoices f|rom the |
|000002f0| 6c 61 73 74 20 74 69 6d | 65 20 74 68 65 20 64 6f |last tim|e the do|
|00000300| 63 75 6d 65 6e 74 09 2a | 2f 0d 2f 2a 20 77 61 73 |cument.*|/./* was|
|00000310| 20 70 72 69 6e 74 65 64 | 20 77 69 6c 6c 20 62 65 | printed| will be|
|00000320| 20 64 69 73 70 6c 61 79 | 65 64 20 61 73 20 64 65 | display|ed as de|
|00000330| 66 61 75 6c 74 73 2e 20 | 20 54 68 69 73 20 70 72 |faults. | This pr|
|00000340| 6f 76 69 64 65 73 20 61 | 20 63 6f 6e 76 65 6e 69 |ovides a| conveni|
|00000350| 65 6e 74 2c 20 64 65 76 | 69 63 65 09 2a 2f 0d 2f |ent, dev|ice.*/./|
|00000360| 2a 20 69 6e 64 65 70 65 | 6e 64 65 6e 74 20 6d 65 |* indepe|ndent me|
|00000370| 74 68 6f 64 20 66 6f 72 | 20 73 61 76 69 6e 67 20 |thod for| saving |
|00000380| 70 72 69 6e 74 20 6a 6f | 62 20 69 6e 66 6f 72 6d |print jo|b inform|
|00000390| 61 74 69 6f 6e 2e 09 09 | 09 09 09 09 09 09 2a 2f |ation...|......*/|
|000003a0| 0d 2f 2a 09 09 09 09 09 | 09 09 09 09 09 09 09 09 |./*.....|........|
|000003b0| 09 09 09 09 09 09 09 09 | 2a 2f 0d 2f 2a 09 4e 4f |........|*/./*.NO|
|000003c0| 54 45 3a 20 09 49 6e 66 | 6f 72 6d 61 74 69 6f 6e |TE: .Inf|ormation|
|000003d0| 20 66 72 6f 6d 20 74 68 | 65 20 50 61 67 65 20 53 | from th|e Page S|
|000003e0| 65 74 75 70 20 64 69 61 | 6c 6f 67 20 69 73 20 73 |etup dia|log is s|
|000003f0| 61 76 65 64 20 69 6e 74 | 6f 20 74 68 65 20 70 72 |aved int|o the pr|
|00000400| 69 6e 74 20 72 65 63 6f | 72 64 2e 09 2a 2f 0d 2f |int reco|rd..*/./|
|00000410| 2a 09 09 09 49 6e 66 6f | 72 6d 61 74 69 6f 6e 20 |*...Info|rmation |
|00000420| 66 72 6f 6d 20 74 68 65 | 20 50 72 69 6e 74 20 64 |from the| Print d|
|00000430| 69 61 6c 6f 67 20 28 69 | 2e 65 2e 20 23 20 6f 66 |ialog (i|.e. # of|
|00000440| 20 63 6f 70 69 65 73 2c | 20 70 61 67 65 20 72 61 | copies,| page ra|
|00000450| 6e 67 65 2e 2e 2e 29 20 | 69 73 09 2a 2f 0d 2f 2a |nge...) |is.*/./*|
|00000460| 09 09 09 63 6f 6e 73 69 | 64 65 72 65 64 20 74 6f |...consi|dered to|
|00000470| 20 62 65 20 70 65 72 20 | 6a 6f 62 20 69 6e 66 6f | be per |job info|
|00000480| 72 6d 61 74 69 6f 6e 2c | 20 61 6e 64 20 69 73 20 |rmation,| and is |
|00000490| 6e 6f 74 20 73 61 76 65 | 64 2e 20 20 54 68 69 73 |not save|d. This|
|000004a0| 20 6d 65 74 68 6f 64 20 | 09 2a 2f 0d 2f 2a 09 09 | method |.*/./*..|
|000004b0| 09 77 69 6c 6c 20 6e 6f | 74 20 61 6c 6c 6f 77 20 |.will no|t allow |
|000004c0| 79 6f 75 20 74 6f 20 70 | 72 6f 76 69 64 65 20 6e |you to p|rovide n|
|000004d0| 65 77 20 64 65 66 61 75 | 6c 74 73 20 66 6f 72 20 |ew defau|lts for |
|000004e0| 74 68 65 20 50 72 4a 6f | 62 44 69 61 6c 6f 67 2e |the PrJo|bDialog.|
|000004f0| 09 09 09 2a 2f 0d 2f 2a | 09 09 09 09 09 09 09 09 |...*/./*|........|
|00000500| 09 09 09 09 09 09 09 09 | 09 09 09 09 09 2a 2f 0d |........|.....*/.|
|00000510| 0d 23 69 6e 63 6c 75 64 | 65 20 3c 54 79 70 65 73 |.#includ|e <Types|
|00000520| 2e 68 3e 0d 23 69 6e 63 | 6c 75 64 65 20 3c 52 65 |.h>.#inc|lude <Re|
|00000530| 73 6f 75 72 63 65 73 2e | 68 3e 0d 23 69 6e 63 6c |sources.|h>.#incl|
|00000540| 75 64 65 20 3c 51 75 69 | 63 6b 44 72 61 77 2e 68 |ude <Qui|ckDraw.h|
|00000550| 3e 0d 23 69 6e 63 6c 75 | 64 65 20 3c 46 6f 6e 74 |>.#inclu|de <Font|
|00000560| 73 2e 68 3e 0d 23 69 6e | 63 6c 75 64 65 20 3c 45 |s.h>.#in|clude <E|
|00000570| 76 65 6e 74 73 2e 68 3e | 0d 23 69 6e 63 6c 75 64 |vents.h>|.#includ|
|00000580| 65 20 3c 57 69 6e 64 6f | 77 73 2e 68 3e 0d 23 69 |e <Windo|ws.h>.#i|
|00000590| 6e 63 6c 75 64 65 20 3c | 4d 65 6e 75 73 2e 68 3e |nclude <|Menus.h>|
|000005a0| 0d 23 69 6e 63 6c 75 64 | 65 20 3c 4d 65 6d 6f 72 |.#includ|e <Memor|
|000005b0| 79 2e 68 3e 0d 23 69 6e | 63 6c 75 64 65 20 3c 46 |y.h>.#in|clude <F|
|000005c0| 69 6c 65 73 2e 68 3e 0d | 23 69 6e 63 6c 75 64 65 |iles.h>.|#include|
|000005d0| 20 3c 50 72 69 6e 74 69 | 6e 67 2e 68 3e 0d 23 69 | <Printi|ng.h>.#i|
|000005e0| 6e 63 6c 75 64 65 20 3c | 54 72 61 70 73 2e 68 3e |nclude <|Traps.h>|
|000005f0| 0d 0d 2f 2a 20 50 4f 50 | 54 20 3d 20 50 72 69 6e |../* POP|T = Prin|
|00000600| 74 20 4f 50 54 69 6f 6e | 73 2e 20 20 54 68 69 73 |t OPTion|s. This|
|00000610| 20 74 79 70 65 20 63 61 | 6e 20 62 65 20 61 6e 79 | type ca|n be any|
|00000620| 74 68 69 6e 67 09 2a 2f | 0d 2f 2a 20 62 75 74 20 |thing.*/|./* but |
|00000630| 74 6f 20 61 76 6f 69 64 | 20 63 6f 6e 66 75 73 69 |to avoid| confusi|
|00000640| 6f 6e 20 77 69 74 68 20 | 50 72 69 6e 74 69 6e 67 |on with |Printing|
|00000650| 20 4d 61 6e 61 67 65 72 | 09 09 2a 2f 0d 2f 2a 20 | Manager|..*/./* |
|00000660| 72 65 73 6f 75 72 63 65 | 73 2c 20 74 68 65 20 66 |resource|s, the f|
|00000670| 6f 6c 6c 6f 77 69 6e 67 | 20 74 79 70 65 73 20 73 |ollowing| types s|
|00000680| 68 6f 75 6c 64 20 4e 4f | 54 20 62 65 09 09 2a 2f |hould NO|T be..*/|
|00000690| 0d 2f 2a 20 75 73 65 64 | 3a 20 50 52 45 43 2c 20 |./* used|: PREC, |
|000006a0| 50 44 45 46 2c 20 26 20 | 50 4f 53 54 2e 2e 2e 09 |PDEF, & |POST....|
|000006b0| 09 09 09 09 09 2a 2f 0d | 23 64 65 66 69 6e 65 09 |.....*/.|#define.|
|000006c0| 67 50 52 52 65 73 54 79 | 70 65 09 27 50 4f 50 54 |gPRResTy|pe.'POPT|
|000006d0| 27 0d 0d 2f 2a 20 54 68 | 69 73 20 63 61 6e 20 61 |'../* Th|is can a|
|000006e0| 6c 73 6f 20 62 65 20 61 | 6e 79 20 76 61 6c 75 65 |lso be a|ny value|
|000006f0| 2e 20 20 53 69 6e 63 65 | 20 74 68 65 72 65 20 73 |. Since| there s|
|00000700| 68 6f 75 6c 64 09 2a 2f | 0d 2f 2a 20 6f 6e 6c 79 |hould.*/|./* only|
|00000710| 20 62 65 20 6f 6e 65 20 | 70 72 69 6e 74 20 72 65 | be one |print re|
|00000720| 63 6f 72 64 20 70 65 72 | 20 64 6f 63 75 6d 65 6e |cord per| documen|
|00000730| 74 2c 20 74 68 65 20 49 | 44 20 69 73 09 2a 2f 0d |t, the I|D is.*/.|
|00000740| 2f 2a 20 61 20 63 6f 6e | 73 74 61 6e 74 2e 09 09 |/* a con|stant...|
|00000750| 09 09 09 09 09 09 09 09 | 2a 2f 0d 23 64 65 66 69 |........|*/.#defi|
|00000760| 6e 65 09 67 50 52 52 65 | 73 49 44 09 31 32 38 0d |ne.gPRRe|sID.128.|
|00000770| 0d 2f 2a 20 52 65 73 6f | 75 72 63 65 20 6e 61 6d |./* Reso|urce nam|
|00000780| 65 2e 20 2a 2f 0d 23 64 | 65 66 69 6e 65 09 67 50 |e. */.#d|efine.gP|
|00000790| 52 52 65 73 4e 61 6d 65 | 09 22 5c 70 50 72 69 6e |RResName|."\pPrin|
|000007a0| 74 20 52 65 63 6f 72 64 | 22 0d 0d 2f 2a 20 44 65 |t Record|"../* De|
|000007b0| 66 69 6e 65 20 74 68 65 | 20 67 6c 6f 62 61 6c 73 |fine the| globals|
|000007c0| 20 66 6f 72 20 74 68 69 | 73 20 70 72 6f 67 72 61 | for thi|s progra|
|000007d0| 6d 2e 2e 2e 20 2a 2f 0d | 54 48 50 72 69 6e 74 09 |m... */.|THPrint.|
|000007e0| 67 50 72 69 6e 74 52 65 | 63 6f 72 64 48 64 6c 3b |gPrintRe|cordHdl;|
|000007f0| 0d 73 68 6f 72 74 09 67 | 54 61 72 67 65 74 52 65 |.short.g|TargetRe|
|00000800| 73 46 69 6c 65 3b 0d 0d | 0d 2f 2a 20 52 65 70 6f |sFile;..|./* Repo|
|00000810| 72 74 45 72 72 6f 72 09 | 09 09 09 09 09 09 09 09 |rtError.|........|
|00000820| 09 09 09 09 09 09 09 09 | 09 2a 2f 0d 2f 2a 09 09 |........|.*/./*..|
|00000830| 09 09 09 09 09 09 09 09 | 09 09 09 09 09 09 09 09 |........|........|
|00000840| 09 09 09 2a 2f 0d 2f 2a | 09 54 68 69 73 20 70 72 |...*/./*|.This pr|
|00000850| 6f 63 65 64 75 72 65 20 | 69 73 20 72 65 73 70 6f |ocedure |is respo|
|00000860| 6e 73 69 62 6c 65 20 66 | 6f 72 20 72 65 70 6f 72 |nsible f|or repor|
|00000870| 74 69 6e 67 20 61 6e 20 | 65 72 72 6f 72 20 74 6f |ting an |error to|
|00000880| 20 74 68 65 20 75 73 65 | 72 2e 20 20 54 68 69 73 | the use|r. This|
|00000890| 20 69 73 20 64 6f 6e 65 | 09 2a 2f 0d 2f 2a 20 62 | is done|.*/./* b|
|000008a0| 79 20 66 69 72 73 74 20 | 63 6f 6e 76 65 72 74 69 |y first |converti|
|000008b0| 6e 67 20 74 68 65 20 65 | 72 72 6f 72 20 63 6f 64 |ng the e|rror cod|
|000008c0| 65 20 70 61 73 73 65 64 | 20 69 6e 20 74 68 65 45 |e passed| in theE|
|000008d0| 72 72 6f 72 20 69 6e 74 | 6f 20 61 20 6d 65 73 73 |rror int|o a mess|
|000008e0| 61 67 65 20 74 68 61 74 | 20 63 61 6e 20 62 65 09 |age that| can be.|
|000008f0| 2a 2f 0d 2f 2a 20 64 69 | 73 70 6c 61 79 65 64 20 |*/./* di|splayed |
|00000900| 66 6f 72 20 74 68 65 20 | 75 73 65 72 2e 20 20 53 |for the |user. S|
|00000910| 65 65 20 54 65 63 68 6e | 69 63 61 6c 20 4e 6f 74 |ee Techn|ical Not|
|00000920| 65 20 23 31 36 31 2c 20 | 22 57 68 65 6e 20 74 6f |e #161, |"When to|
|00000930| 20 63 61 6c 6c 20 50 72 | 4f 70 65 6e 20 61 6e 64 | call Pr|Open and|
|00000940| 09 09 2a 2f 0d 2f 2a 20 | 50 72 43 6c 6f 73 65 22 |..*/./* |PrClose"|
|00000950| 2e 09 09 09 09 09 09 09 | 09 09 09 09 09 09 09 09 |........|........|
|00000960| 09 09 09 2a 2f 0d 76 6f | 69 64 20 52 65 70 6f 72 |...*/.vo|id Repor|
|00000970| 74 45 72 72 6f 72 28 74 | 68 65 45 72 72 6f 72 29 |tError(t|heError)|
|00000980| 0d 4f 53 45 72 72 09 74 | 68 65 45 72 72 6f 72 3b |.OSErr.t|heError;|
|00000990| 0d 7b 0d 09 2f 2a 20 52 | 65 61 6c 20 70 72 6f 67 |.{../* R|eal prog|
|000009a0| 72 61 6d 73 20 68 61 6e | 64 6c 65 20 65 72 72 6f |rams han|dle erro|
|000009b0| 72 73 20 62 79 20 64 69 | 73 70 6c 61 79 65 64 20 |rs by di|splayed |
|000009c0| 63 6f 6d 70 72 65 68 65 | 6e 73 69 62 6c 65 20 65 |comprehe|nsible e|
|000009d0| 72 72 6f 72 20 6d 65 73 | 73 61 67 65 73 2e 09 09 |rror mes|sages...|
|000009e0| 2a 2f 0d 09 2f 2a 20 54 | 68 69 73 20 69 73 20 4e |*/../* T|his is N|
|000009f0| 4f 54 20 61 20 72 65 61 | 6c 20 70 72 6f 67 72 61 |OT a rea|l progra|
|00000a00| 6d 2e 2e 2e 09 09 09 09 | 09 09 09 09 09 09 09 09 |m.......|........|
|00000a10| 2a 2f 0d 09 69 66 20 28 | 74 68 65 45 72 72 6f 72 |*/..if (|theError|
|00000a20| 20 21 3d 20 6e 6f 45 72 | 72 29 0d 09 09 53 79 73 | != noEr|r)...Sys|
|00000a30| 42 65 65 70 28 31 30 29 | 3b 0d 7d 0d 0d 0d 2f 2a |Beep(10)|;.}.../*|
|00000a40| 20 49 6e 69 74 69 61 6c | 69 7a 65 50 72 69 6e 74 | Initial|izePrint|
|00000a50| 52 65 63 6f 72 64 09 09 | 09 09 09 09 09 09 09 09 |Record..|........|
|00000a60| 09 09 09 09 09 2a 2f 0d | 2f 2a 09 09 09 09 09 09 |.....*/.|/*......|
|00000a70| 09 09 09 09 09 09 09 09 | 09 09 09 09 09 09 09 2a |........|.......*|
|00000a80| 2f 0d 2f 2a 20 20 54 68 | 69 73 20 70 72 6f 63 65 |/./* Th|is proce|
|00000a90| 64 75 72 65 20 69 73 20 | 72 65 73 70 6f 6e 73 69 |dure is |responsi|
|00000aa0| 62 6c 65 20 66 6f 72 20 | 69 6e 69 74 69 61 6c 69 |ble for |initiali|
|00000ab0| 7a 69 6e 67 20 61 20 6e | 65 77 6c 79 20 63 72 65 |zing a n|ewly cre|
|00000ac0| 61 74 65 64 20 70 72 69 | 6e 74 20 72 65 63 6f 72 |ated pri|nt recor|
|00000ad0| 64 2e 09 2a 2f 0d 2f 2a | 20 49 74 20 62 65 67 69 |d..*/./*| It begi|
|00000ae0| 6e 73 20 62 79 20 63 61 | 6c 6c 69 6e 67 20 50 72 |ns by ca|lling Pr|
|00000af0| 69 6e 74 44 65 66 61 75 | 6c 74 20 74 6f 20 66 69 |intDefau|lt to fi|
|00000b00| 6c 6c 20 69 6e 20 64 65 | 66 61 75 6c 74 20 76 61 |ll in de|fault va|
|00000b10| 6c 75 65 73 2c 20 61 6e | 64 20 74 68 65 6e 20 70 |lues, an|d then p|
|00000b20| 72 65 73 65 6e 74 73 09 | 2a 2f 0d 2f 2a 20 74 68 |resents.|*/./* th|
|00000b30| 65 20 73 74 61 6e 64 61 | 72 64 20 27 50 61 67 65 |e standa|rd 'Page|
|00000b40| 20 53 65 74 75 70 27 20 | 64 69 61 6c 6f 67 20 61 | Setup' |dialog a|
|00000b50| 6c 6c 6f 77 69 6e 67 20 | 74 68 65 20 75 73 65 72 |llowing |the user|
|00000b60| 20 74 6f 20 73 70 65 63 | 69 66 79 20 70 61 67 65 | to spec|ify page|
|00000b70| 20 73 65 74 75 70 20 6f | 70 74 69 6f 6e 73 2e 2a | setup o|ptions.*|
|00000b80| 2f 0d 2f 2a 20 54 68 65 | 20 6d 6f 64 69 66 69 65 |/./* The| modifie|
|00000b90| 64 20 70 72 69 6e 74 20 | 72 65 63 6f 72 64 20 69 |d print |record i|
|00000ba0| 73 20 74 68 65 6e 20 72 | 65 74 75 72 6e 65 64 2e |s then r|eturned.|
|00000bb0| 09 09 09 09 09 09 09 09 | 09 09 2a 2f 0d 76 6f 69 |........|..*/.voi|
|00000bc0| 64 20 49 6e 69 74 69 61 | 6c 69 7a 65 50 72 69 6e |d Initia|lizePrin|
|00000bd0| 74 52 65 63 6f 72 64 28 | 74 68 65 50 72 69 6e 74 |tRecord(|thePrint|
|00000be0| 52 65 63 6f 72 64 29 0d | 54 48 50 72 69 6e 74 09 |Record).|THPrint.|
|00000bf0| 74 68 65 50 72 69 6e 74 | 52 65 63 6f 72 64 3b 0d |thePrint|Record;.|
|00000c00| 7b 0d 09 42 6f 6f 6c 65 | 61 6e 09 69 67 6e 6f 72 |{..Boole|an.ignor|
|00000c10| 65 64 3b 0d 0d 09 50 72 | 4f 70 65 6e 28 29 3b 0d |ed;...Pr|Open();.|
|00000c20| 09 69 66 20 28 50 72 45 | 72 72 6f 72 28 29 20 3d |.if (PrE|rror() =|
|00000c30| 3d 20 6e 6f 45 72 72 29 | 20 7b 0d 09 09 50 72 69 |= noErr)| {...Pri|
|00000c40| 6e 74 44 65 66 61 75 6c | 74 28 74 68 65 50 72 69 |ntDefaul|t(thePri|
|00000c50| 6e 74 52 65 63 6f 72 64 | 29 3b 0d 09 09 69 67 6e |ntRecord|);...ign|
|00000c60| 6f 72 65 64 20 3d 20 50 | 72 53 74 6c 44 69 61 6c |ored = P|rStlDial|
|00000c70| 6f 67 28 74 68 65 50 72 | 69 6e 74 52 65 63 6f 72 |og(thePr|intRecor|
|00000c80| 64 29 3b 0d 09 7d 0d 09 | 50 72 43 6c 6f 73 65 28 |d);..}..|PrClose(|
|00000c90| 29 3b 0d 7d 0d 0d 0d 2f | 2a 20 53 61 76 65 50 72 |);.}.../|* SavePr|
|00000ca0| 69 6e 74 52 65 63 6f 72 | 64 09 09 09 09 09 09 09 |intRecor|d.......|
|00000cb0| 09 09 09 09 09 09 09 09 | 09 20 20 09 2a 2f 0d 2f |........|. .*/./|
|00000cc0| 2a 09 09 09 09 09 09 09 | 09 09 09 09 09 09 09 09 |*.......|........|
|00000cd0| 09 09 09 09 09 20 20 09 | 2a 2f 0d 2f 2a 20 20 54 |..... .|*/./* T|
|00000ce0| 68 69 73 20 70 72 6f 63 | 65 64 75 72 65 20 69 73 |his proc|edure is|
|00000cf0| 20 72 65 73 70 6f 6e 73 | 69 62 6c 65 20 66 6f 72 | respons|ible for|
|00000d00| 20 73 61 76 69 6e 67 20 | 61 20 70 72 69 6e 74 20 | saving |a print |
|00000d10| 72 65 63 6f 72 64 20 69 | 6e 74 6f 20 61 20 72 65 |record i|nto a re|
|00000d20| 73 6f 75 72 63 65 20 66 | 69 6c 65 2e 20 20 20 2a |source f|ile. *|
|00000d30| 2f 0d 2f 2a 20 4f 6e 20 | 65 6e 74 72 79 2c 20 74 |/./* On |entry, t|
|00000d40| 68 65 20 70 72 69 6e 74 | 20 72 65 63 6f 72 64 20 |he print| record |
|00000d50| 73 68 6f 75 6c 64 20 62 | 65 20 69 6e 69 74 69 61 |should b|e initia|
|00000d60| 6c 69 7a 65 64 2c 20 61 | 6e 64 20 74 68 65 20 72 |lized, a|nd the r|
|00000d70| 65 73 6f 75 72 63 65 20 | 66 69 6c 65 20 73 68 6f |esource |file sho|
|00000d80| 75 6c 64 20 20 20 2a 2f | 0d 2f 2a 20 62 65 20 6f |uld */|./* be o|
|00000d90| 70 65 6e 20 77 69 74 68 | 20 70 65 72 6d 69 73 73 |pen with| permiss|
|00000da0| 69 6f 6e 20 74 6f 20 77 | 72 69 74 65 2e 09 09 09 |ion to w|rite....|
|00000db0| 09 09 09 09 09 09 09 09 | 09 2a 2f 0d 76 6f 69 64 |........|.*/.void|
|00000dc0| 20 53 61 76 65 50 72 69 | 6e 74 52 65 63 6f 72 64 | SavePri|ntRecord|
|00000dd0| 28 74 68 65 50 72 69 6e | 74 52 65 63 6f 72 64 2c |(thePrin|tRecord,|
|00000de0| 20 74 68 65 52 65 73 46 | 69 6c 65 29 0d 54 48 50 | theResF|ile).THP|
|00000df0| 72 69 6e 74 09 74 68 65 | 50 72 69 6e 74 52 65 63 |rint.the|PrintRec|
|00000e00| 6f 72 64 3b 0d 73 68 6f | 72 74 09 74 68 65 52 65 |ord;.sho|rt.theRe|
|00000e10| 73 46 69 6c 65 3b 0d 7b | 0d 09 73 68 6f 72 74 09 |sFile;.{|..short.|
|00000e20| 63 75 72 72 65 6e 74 52 | 65 73 46 69 6c 65 3b 0d |currentR|esFile;.|
|00000e30| 09 48 61 6e 64 6c 65 09 | 65 78 69 73 74 69 6e 67 |.Handle.|existing|
|00000e40| 52 65 73 48 64 6c 3b 0d | 09 48 61 6e 64 6c 65 09 |ResHdl;.|.Handle.|
|00000e50| 6e 65 77 52 65 73 48 64 | 6c 3b 0d 09 4f 53 45 72 |newResHd|l;..OSEr|
|00000e60| 72 09 74 68 65 45 72 72 | 6f 72 3b 0d 0d 09 2f 2a |r.theErr|or;.../*|
|00000e70| 20 46 69 72 73 74 20 73 | 61 76 65 20 74 68 65 20 | First s|ave the |
|00000e80| 63 75 72 72 65 6e 74 6c | 79 20 73 65 6c 65 63 74 |currentl|y select|
|00000e90| 65 64 20 72 65 73 6f 75 | 72 63 65 20 66 69 6c 65 |ed resou|rce file|
|00000ea0| 20 28 62 65 66 6f 72 65 | 20 63 61 6c 6c 69 6e 67 | (before| calling|
|00000eb0| 20 55 73 65 52 65 73 46 | 69 6c 65 29 2e 20 2a 2f | UseResF|ile). */|
|00000ec0| 0d 09 63 75 72 72 65 6e | 74 52 65 73 46 69 6c 65 |..curren|tResFile|
|00000ed0| 20 3d 20 43 75 72 52 65 | 73 46 69 6c 65 28 29 3b | = CurRe|sFile();|
|00000ee0| 0d 09 0d 09 2f 2a 20 4e | 6f 77 20 73 65 6c 65 63 |..../* N|ow selec|
|00000ef0| 74 20 74 68 65 20 74 61 | 72 67 65 74 20 72 65 73 |t the ta|rget res|
|00000f00| 6f 75 72 63 65 20 66 69 | 6c 65 2e 20 09 09 09 09 |ource fi|le. ....|
|00000f10| 09 09 09 09 09 09 2a 2f | 0d 09 55 73 65 52 65 73 |......*/|..UseRes|
|00000f20| 46 69 6c 65 28 74 68 65 | 52 65 73 46 69 6c 65 29 |File(the|ResFile)|
|00000f30| 3b 0d 09 74 68 65 45 72 | 72 6f 72 20 3d 20 52 65 |;..theEr|ror = Re|
|00000f40| 73 45 72 72 6f 72 28 29 | 3b 0d 09 69 66 20 28 74 |sError()|;..if (t|
|00000f50| 68 65 45 72 72 6f 72 20 | 3d 3d 20 6e 6f 45 72 72 |heError |== noErr|
|00000f60| 29 20 7b 0d 09 09 65 78 | 69 73 74 69 6e 67 52 65 |) {...ex|istingRe|
|00000f70| 73 48 64 6c 20 3d 20 47 | 65 74 52 65 73 6f 75 72 |sHdl = G|etResour|
|00000f80| 63 65 28 67 50 52 52 65 | 73 54 79 70 65 2c 20 67 |ce(gPRRe|sType, g|
|00000f90| 50 52 52 65 73 49 44 29 | 3b 0d 09 09 69 66 20 28 |PRResID)|;...if (|
|00000fa0| 65 78 69 73 74 69 6e 67 | 52 65 73 48 64 6c 20 21 |existing|ResHdl !|
|00000fb0| 3d 20 4e 55 4c 4c 29 20 | 7b 0d 09 09 09 2f 2a 20 |= NULL) |{..../* |
|00000fc0| 54 68 65 72 65 20 69 73 | 20 61 6c 72 65 61 64 79 |There is| already|
|00000fd0| 20 61 20 70 72 69 6e 74 | 20 72 65 63 6f 72 64 20 | a print| record |
|00000fe0| 72 65 73 6f 75 72 63 65 | 20 69 6e 20 74 68 69 73 |resource| in this|
|00000ff0| 20 66 69 6c 65 2c 20 73 | 6f 20 77 65 20 6e 65 65 | file, s|o we nee|
|00001000| 64 20 74 6f 20 2a 2f 0d | 09 09 09 2f 2a 20 64 65 |d to */.|.../* de|
|00001010| 6c 65 74 65 20 69 74 20 | 62 65 66 6f 72 65 20 61 |lete it |before a|
|00001020| 64 64 69 6e 67 20 74 68 | 65 20 6e 65 77 20 6f 6e |dding th|e new on|
|00001030| 65 2e 09 09 09 09 09 09 | 09 09 09 2a 2f 0d 09 09 |e.......|...*/...|
|00001040| 09 52 6d 76 65 52 65 73 | 6f 75 72 63 65 28 65 78 |.RmveRes|ource(ex|
|00001050| 69 73 74 69 6e 67 52 65 | 73 48 64 6c 29 3b 0d 09 |istingRe|sHdl);..|
|00001060| 09 09 74 68 65 45 72 72 | 6f 72 20 3d 20 52 65 73 |..theErr|or = Res|
|00001070| 45 72 72 6f 72 28 29 3b | 0d 09 09 09 69 66 20 28 |Error();|....if (|
|00001080| 74 68 65 45 72 72 6f 72 | 20 3d 3d 20 6e 6f 45 72 |theError| == noEr|
|00001090| 72 29 20 7b 0d 09 09 09 | 09 2f 2a 20 49 66 20 74 |r) {....|./* If t|
|000010a0| 68 65 20 72 65 73 6f 75 | 72 63 65 20 77 61 73 20 |he resou|rce was |
|000010b0| 73 75 63 63 65 73 73 66 | 75 6c 6c 79 20 72 65 6d |successf|ully rem|
|000010c0| 6f 76 65 64 2c 20 64 69 | 73 70 6f 73 65 20 6f 66 |oved, di|spose of|
|000010d0| 20 69 74 73 20 6d 65 6d | 6f 72 79 20 20 2a 2f 0d | its mem|ory */.|
|000010e0| 09 09 09 09 2f 2a 20 61 | 6e 64 20 75 70 64 61 74 |..../* a|nd updat|
|000010f0| 65 20 74 68 65 20 72 65 | 73 6f 75 72 63 65 20 66 |e the re|source f|
|00001100| 69 6c 65 2e 09 09 09 09 | 09 09 09 09 09 2a 2f 0d |ile.....|.....*/.|
|00001110| 09 09 09 09 44 69 73 70 | 6f 73 48 61 6e 64 6c 65 |....Disp|osHandle|
|00001120| 28 65 78 69 73 74 69 6e | 67 52 65 73 48 64 6c 29 |(existin|gResHdl)|
|00001130| 3b 0d 09 09 09 09 55 70 | 64 61 74 65 52 65 73 46 |;.....Up|dateResF|
|00001140| 69 6c 65 28 74 68 65 52 | 65 73 46 69 6c 65 29 3b |ile(theR|esFile);|
|00001150| 0d 09 09 09 7d 0d 09 09 | 7d 0d 09 09 0d 09 09 69 |....}...|}......i|
|00001160| 66 20 28 74 68 65 45 72 | 72 6f 72 20 3d 3d 20 6e |f (theEr|ror == n|
|00001170| 6f 45 72 72 29 20 7b 0d | 09 09 09 2f 2a 20 4f 6b |oErr) {.|.../* Ok|
|00001180| 61 79 2c 20 6e 6f 77 20 | 77 65 20 68 61 76 65 20 |ay, now |we have |
|00001190| 73 75 63 63 65 73 73 66 | 75 6c 6c 79 20 6f 70 65 |successf|ully ope|
|000011a0| 6e 65 64 20 74 68 65 20 | 66 69 6c 65 2c 20 61 6e |ned the |file, an|
|000011b0| 64 20 64 65 6c 65 74 65 | 64 20 61 6e 79 09 09 2a |d delete|d any..*|
|000011c0| 2f 0d 09 09 09 2f 2a 20 | 70 72 65 76 69 6f 75 73 |/..../* |previous|
|000011d0| 6c 79 20 73 61 76 65 64 | 20 70 72 69 6e 74 20 72 |ly saved| print r|
|000011e0| 65 63 6f 72 64 20 72 65 | 73 6f 75 72 63 65 73 2e |ecord re|sources.|
|000011f0| 20 20 46 69 6e 61 6c 6c | 79 20 77 65 20 63 61 6e | Finall|y we can|
|00001200| 20 61 64 64 20 74 68 65 | 20 6e 65 77 20 2a 2f 0d | add the| new */.|
|00001210| 09 09 09 2f 2a 20 6f 6e | 65 2e 2e 2e 09 09 09 09 |.../* on|e.......|
|00001220| 09 09 09 09 09 09 09 09 | 09 09 09 09 2a 2f 0d 09 |........|....*/..|
|00001230| 09 09 2f 2a 20 53 69 6e | 63 65 20 74 68 65 20 52 |../* Sin|ce the R|
|00001240| 65 73 6f 75 72 63 65 20 | 4d 61 6e 61 67 65 72 20 |esource |Manager |
|00001250| 69 73 20 67 6f 69 6e 67 | 20 74 6f 20 6b 65 65 70 |is going| to keep|
|00001260| 20 74 68 65 20 68 61 6e | 64 6c 65 20 77 65 20 70 | the han|dle we p|
|00001270| 61 73 73 20 69 74 2c 09 | 2a 2f 0d 09 09 09 2f 2a |ass it,.|*/..../*|
|00001280| 20 77 65 20 6e 65 65 64 | 20 74 6f 20 6d 61 6b 65 | we need| to make|
|00001290| 20 61 20 63 6f 70 79 20 | 62 65 66 6f 72 65 20 63 | a copy |before c|
|000012a0| 61 6c 6c 69 6e 67 20 41 | 64 64 52 65 73 6f 75 72 |alling A|ddResour|
|000012b0| 63 65 2e 20 20 57 65 27 | 6c 6c 20 6c 65 74 20 74 |ce. We'|ll let t|
|000012c0| 68 65 09 2a 2f 0d 09 09 | 09 2f 2a 20 73 79 73 74 |he.*/...|./* syst|
|000012d0| 65 6d 20 64 6f 20 69 74 | 20 66 6f 72 20 75 73 20 |em do it| for us |
|000012e0| 62 79 20 63 61 6c 6c 69 | 6e 67 20 48 61 6e 64 54 |by calli|ng HandT|
|000012f0| 6f 48 61 6e 64 2e 09 09 | 09 09 09 09 09 2a 2f 0d |oHand...|.....*/.|
|00001300| 09 09 09 6e 65 77 52 65 | 73 48 64 6c 20 3d 20 28 |...newRe|sHdl = (|
|00001310| 48 61 6e 64 6c 65 29 74 | 68 65 50 72 69 6e 74 52 |Handle)t|hePrintR|
|00001320| 65 63 6f 72 64 3b 0d 09 | 09 09 74 68 65 45 72 72 |ecord;..|..theErr|
|00001330| 6f 72 20 3d 20 48 61 6e | 64 54 6f 48 61 6e 64 28 |or = Han|dToHand(|
|00001340| 26 6e 65 77 52 65 73 48 | 64 6c 29 3b 0d 09 09 09 |&newResH|dl);....|
|00001350| 69 66 20 28 74 68 65 45 | 72 72 6f 72 20 3d 3d 20 |if (theE|rror == |
|00001360| 6e 6f 45 72 72 29 20 7b | 0d 09 09 09 09 41 64 64 |noErr) {|.....Add|
|00001370| 52 65 73 6f 75 72 63 65 | 28 6e 65 77 52 65 73 48 |Resource|(newResH|
|00001380| 64 6c 2c 20 67 50 52 52 | 65 73 54 79 70 65 2c 20 |dl, gPRR|esType, |
|00001390| 67 50 52 52 65 73 49 44 | 2c 20 67 50 52 52 65 73 |gPRResID|, gPRRes|
|000013a0| 4e 61 6d 65 29 3b 0d 09 | 09 09 09 74 68 65 45 72 |Name);..|...theEr|
|000013b0| 72 6f 72 20 3d 20 52 65 | 73 45 72 72 6f 72 28 29 |ror = Re|sError()|
|000013c0| 3b 0d 09 09 09 09 69 66 | 20 28 74 68 65 45 72 72 |;.....if| (theErr|
|000013d0| 6f 72 20 3d 3d 20 6e 6f | 45 72 72 29 20 0d 09 09 |or == no|Err) ...|
|000013e0| 09 09 09 55 70 64 61 74 | 65 52 65 73 46 69 6c 65 |...Updat|eResFile|
|000013f0| 28 74 68 65 52 65 73 46 | 69 6c 65 29 3b 0d 09 09 |(theResF|ile);...|
|00001400| 09 09 74 68 65 45 72 72 | 6f 72 20 3d 20 52 65 73 |..theErr|or = Res|
|00001410| 45 72 72 6f 72 28 29 3b | 0d 09 09 09 7d 0d 09 09 |Error();|....}...|
|00001420| 7d 20 20 20 0d 09 7d 0d | 09 69 66 20 28 74 68 65 |} ..}.|.if (the|
|00001430| 45 72 72 6f 72 20 21 3d | 20 6e 6f 45 72 72 29 0d |Error !=| noErr).|
|00001440| 09 09 52 65 70 6f 72 74 | 45 72 72 6f 72 28 74 68 |..Report|Error(th|
|00001450| 65 45 72 72 6f 72 29 3b | 0d 09 0d 09 2f 2a 20 42 |eError);|..../* B|
|00001460| 65 20 70 6f 6c 69 74 65 | 20 61 6e 64 20 72 65 73 |e polite| and res|
|00001470| 74 6f 72 65 20 74 68 65 | 20 6f 72 69 67 69 6e 61 |tore the| origina|
|00001480| 6c 20 72 65 73 6f 75 72 | 63 65 20 66 69 6c 65 20 |l resour|ce file |
|00001490| 74 6f 20 74 68 65 20 74 | 6f 70 20 6f 66 20 74 68 |to the t|op of th|
|000014a0| 65 20 63 68 61 69 6e 2e | 09 2a 2f 0d 09 55 73 65 |e chain.|.*/..Use|
|000014b0| 52 65 73 46 69 6c 65 28 | 63 75 72 72 65 6e 74 52 |ResFile(|currentR|
|000014c0| 65 73 46 69 6c 65 29 3b | 0d 7d 0d 0d 0d 2f 2a 20 |esFile);|.}.../* |
|000014d0| 47 65 74 50 72 69 6e 74 | 52 65 63 6f 72 64 09 09 |GetPrint|Record..|
|000014e0| 09 09 09 09 09 09 09 09 | 09 09 09 09 09 09 09 2a |........|.......*|
|000014f0| 2f 0d 2f 2a 09 09 09 09 | 09 09 09 09 09 09 09 09 |/./*....|........|
|00001500| 09 09 09 09 09 09 09 09 | 09 2a 2f 0d 2f 2a 20 20 |........|.*/./* |
|00001510| 54 68 69 73 20 66 75 6e | 63 74 69 6f 6e 20 69 73 |This fun|ction is|
|00001520| 20 72 65 73 70 6f 6e 73 | 69 62 6c 65 20 66 6f 72 | respons|ible for|
|00001530| 20 6c 6f 61 64 69 6e 67 | 20 61 20 72 65 73 6f 75 | loading| a resou|
|00001540| 72 63 65 20 63 6f 6e 74 | 61 69 6e 69 6e 67 20 61 |rce cont|aining a|
|00001550| 20 76 61 6c 69 64 20 70 | 72 69 6e 74 09 2a 2f 0d | valid p|rint.*/.|
|00001560| 2f 2a 20 72 65 63 6f 72 | 64 2e 20 20 4f 6e 20 65 |/* recor|d. On e|
|00001570| 6e 74 72 79 20 74 68 65 | 52 65 73 46 69 6c 65 20 |ntry the|ResFile |
|00001580| 73 68 6f 75 6c 64 20 62 | 65 20 6f 70 65 6e 20 77 |should b|e open w|
|00001590| 69 74 68 20 70 65 72 6d | 69 73 73 69 6f 6e 20 74 |ith perm|ission t|
|000015a0| 6f 20 72 65 61 64 2e 09 | 09 09 09 2a 2f 0d 54 48 |o read..|...*/.TH|
|000015b0| 50 72 69 6e 74 20 47 65 | 74 50 72 69 6e 74 52 65 |Print Ge|tPrintRe|
|000015c0| 63 6f 72 64 28 74 68 65 | 52 65 73 46 69 6c 65 29 |cord(the|ResFile)|
|000015d0| 0d 73 68 6f 72 74 09 74 | 68 65 52 65 73 46 69 6c |.short.t|heResFil|
|000015e0| 65 3b 0d 7b 0d 09 73 68 | 6f 72 74 09 63 75 72 72 |e;.{..sh|ort.curr|
|000015f0| 65 6e 74 52 65 73 46 69 | 6c 65 3b 0d 09 48 61 6e |entResFi|le;..Han|
|00001600| 64 6c 65 09 74 68 65 52 | 65 73 6f 75 72 63 65 3b |dle.theR|esource;|
|00001610| 0d 09 4f 53 45 72 72 09 | 74 68 65 45 72 72 6f 72 |..OSErr.|theError|
|00001620| 3b 0d 0d 09 63 75 72 72 | 65 6e 74 52 65 73 46 69 |;...curr|entResFi|
|00001630| 6c 65 20 3d 20 43 75 72 | 52 65 73 46 69 6c 65 28 |le = Cur|ResFile(|
|00001640| 29 3b 0d 09 55 73 65 52 | 65 73 46 69 6c 65 28 74 |);..UseR|esFile(t|
|00001650| 68 65 52 65 73 46 69 6c | 65 29 3b 0d 09 74 68 65 |heResFil|e);..the|
|00001660| 45 72 72 6f 72 20 3d 20 | 52 65 73 45 72 72 6f 72 |Error = |ResError|
|00001670| 28 29 3b 0d 09 69 66 20 | 28 74 68 65 45 72 72 6f |();..if |(theErro|
|00001680| 72 20 3d 3d 20 6e 6f 45 | 72 72 29 20 7b 0d 09 09 |r == noE|rr) {...|
|00001690| 74 68 65 52 65 73 6f 75 | 72 63 65 20 3d 20 47 65 |theResou|rce = Ge|
|000016a0| 74 52 65 73 6f 75 72 63 | 65 28 67 50 52 52 65 73 |tResourc|e(gPRRes|
|000016b0| 54 79 70 65 2c 20 67 50 | 52 52 65 73 49 44 29 3b |Type, gP|RResID);|
|000016c0| 0d 09 09 74 68 65 45 72 | 72 6f 72 20 3d 20 52 65 |...theEr|ror = Re|
|000016d0| 73 45 72 72 6f 72 28 29 | 3b 0d 09 09 69 66 20 28 |sError()|;...if (|
|000016e0| 74 68 65 45 72 72 6f 72 | 20 3d 3d 20 6e 6f 45 72 |theError| == noEr|
|000016f0| 72 29 20 7b 0d 09 09 09 | 50 72 4f 70 65 6e 28 29 |r) {....|PrOpen()|
|00001700| 3b 0d 09 09 09 74 68 65 | 45 72 72 6f 72 20 3d 20 |;....the|Error = |
|00001710| 50 72 45 72 72 6f 72 28 | 29 3b 0d 09 09 09 69 66 |PrError(|);....if|
|00001720| 20 28 74 68 65 45 72 72 | 6f 72 20 3d 3d 20 6e 6f | (theErr|or == no|
|00001730| 45 72 72 29 20 7b 0d 09 | 09 09 09 69 66 20 28 50 |Err) {..|...if (P|
|00001740| 72 56 61 6c 69 64 61 74 | 65 28 28 54 48 50 72 69 |rValidat|e((THPri|
|00001750| 6e 74 29 74 68 65 52 65 | 73 6f 75 72 63 65 29 29 |nt)theRe|source))|
|00001760| 20 3b 0d 09 09 09 7d 0d | 09 09 09 50 72 43 6c 6f | ;....}.|...PrClo|
|00001770| 73 65 28 29 3b 0d 09 09 | 7d 0d 09 7d 0d 09 69 66 |se();...|}..}..if|
|00001780| 20 28 74 68 65 45 72 72 | 6f 72 20 21 3d 20 6e 6f | (theErr|or != no|
|00001790| 45 72 72 29 0d 09 09 52 | 65 70 6f 72 74 45 72 72 |Err)...R|eportErr|
|000017a0| 6f 72 28 74 68 65 45 72 | 72 6f 72 29 3b 0d 09 55 |or(theEr|ror);..U|
|000017b0| 73 65 52 65 73 46 69 6c | 65 28 63 75 72 72 65 6e |seResFil|e(curren|
|000017c0| 74 52 65 73 46 69 6c 65 | 29 3b 0d 09 72 65 74 75 |tResFile|);..retu|
|000017d0| 72 6e 28 28 54 48 50 72 | 69 6e 74 29 74 68 65 52 |rn((THPr|int)theR|
|000017e0| 65 73 6f 75 72 63 65 29 | 3b 0d 7d 0d 0d 0d 2f 2a |esource)|;.}.../*|
|000017f0| 20 54 65 73 74 50 72 69 | 6e 74 52 65 63 6f 72 64 | TestPri|ntRecord|
|00001800| 09 09 09 09 09 09 09 09 | 09 09 09 09 09 09 09 09 |........|........|
|00001810| 20 20 09 2a 2f 0d 2f 2a | 09 09 09 09 09 09 09 09 | .*/./*|........|
|00001820| 09 09 09 09 09 09 09 09 | 09 09 09 09 20 20 09 2a |........|.... .*|
|00001830| 2f 0d 2f 2a 20 20 54 68 | 69 73 20 70 72 6f 63 65 |/./* Th|is proce|
|00001840| 64 75 72 65 20 69 73 20 | 75 73 65 64 20 74 6f 20 |dure is |used to |
|00001850| 74 65 73 74 20 61 20 70 | 72 69 6e 74 20 72 65 63 |test a p|rint rec|
|00001860| 6f 72 64 2e 20 20 49 74 | 20 77 69 6c 6c 20 70 72 |ord. It| will pr|
|00001870| 69 6e 74 20 61 20 6c 69 | 6e 65 20 6f 66 20 74 65 |int a li|ne of te|
|00001880| 78 74 09 2a 2f 0d 2f 2a | 20 75 73 69 6e 67 20 74 |xt.*/./*| using t|
|00001890| 68 65 20 6f 70 74 69 6f | 6e 73 20 73 70 65 63 69 |he optio|ns speci|
|000018a0| 66 69 65 64 20 69 6e 20 | 74 68 65 50 72 69 6e 74 |fied in |thePrint|
|000018b0| 52 65 63 6f 72 64 20 70 | 61 73 73 65 64 2e 20 20 |Record p|assed. |
|000018c0| 4f 6e 20 65 78 69 74 2c | 20 61 20 6c 69 6e 65 20 |On exit,| a line |
|000018d0| 6f 66 20 74 65 78 74 20 | 20 20 2a 2f 0d 2f 2a 20 |of text | */./* |
|000018e0| 77 69 6c 6c 20 68 61 76 | 65 20 62 65 65 6e 20 70 |will hav|e been p|
|000018f0| 72 69 6e 74 65 64 2e 09 | 09 09 09 09 09 09 09 09 |rinted..|........|
|00001900| 09 09 09 09 09 20 20 09 | 2a 2f 0d 76 6f 69 64 20 |..... .|*/.void |
|00001910| 54 65 73 74 50 72 69 6e | 74 52 65 63 6f 72 64 28 |TestPrin|tRecord(|
|00001920| 74 68 65 50 72 69 6e 74 | 52 65 63 6f 72 64 29 0d |thePrint|Record).|
|00001930| 54 48 50 72 69 6e 74 09 | 74 68 65 50 72 69 6e 74 |THPrint.|thePrint|
|00001940| 52 65 63 6f 72 64 3b 0d | 7b 0d 09 47 72 61 66 50 |Record;.|{..GrafP|
|00001950| 74 72 09 09 63 75 72 72 | 65 6e 74 50 6f 72 74 3b |tr..curr|entPort;|
|00001960| 0d 09 54 50 50 72 50 6f | 72 74 09 74 68 65 50 4d |..TPPrPo|rt.thePM|
|00001970| 50 6f 72 74 3b 0d 09 4f | 53 45 72 72 09 09 74 68 |Port;..O|SErr..th|
|00001980| 65 45 72 72 6f 72 3b 0d | 09 54 50 72 53 74 61 74 |eError;.|.TPrStat|
|00001990| 75 73 09 74 68 65 50 4d | 53 74 61 74 75 73 3b 0d |us.thePM|Status;.|
|000019a0| 0d 09 47 65 74 50 6f 72 | 74 28 26 63 75 72 72 65 |..GetPor|t(&curre|
|000019b0| 6e 74 50 6f 72 74 29 3b | 0d 09 50 72 4f 70 65 6e |ntPort);|..PrOpen|
|000019c0| 28 29 3b 0d 09 69 66 20 | 28 50 72 45 72 72 6f 72 |();..if |(PrError|
|000019d0| 28 29 20 3d 3d 20 6e 6f | 45 72 72 29 20 7b 0d 09 |() == no|Err) {..|
|000019e0| 09 69 66 20 28 50 72 4a | 6f 62 44 69 61 6c 6f 67 |.if (PrJ|obDialog|
|000019f0| 28 74 68 65 50 72 69 6e | 74 52 65 63 6f 72 64 29 |(thePrin|tRecord)|
|00001a00| 29 20 7b 0d 09 09 09 74 | 68 65 50 4d 50 6f 72 74 |) {....t|hePMPort|
|00001a10| 20 3d 20 50 72 4f 70 65 | 6e 44 6f 63 28 74 68 65 | = PrOpe|nDoc(the|
|00001a20| 50 72 69 6e 74 52 65 63 | 6f 72 64 2c 20 4e 55 4c |PrintRec|ord, NUL|
|00001a30| 4c 2c 20 4e 55 4c 4c 29 | 3b 0d 09 09 09 69 66 20 |L, NULL)|;....if |
|00001a40| 28 50 72 45 72 72 6f 72 | 28 29 20 3d 3d 20 6e 6f |(PrError|() == no|
|00001a50| 45 72 72 29 20 7b 0d 09 | 09 09 09 50 72 4f 70 65 |Err) {..|...PrOpe|
|00001a60| 6e 50 61 67 65 28 74 68 | 65 50 4d 50 6f 72 74 2c |nPage(th|ePMPort,|
|00001a70| 20 4e 55 4c 4c 29 3b 0d | 09 09 09 09 69 66 20 28 | NULL);.|....if (|
|00001a80| 50 72 45 72 72 6f 72 28 | 29 20 3d 3d 20 6e 6f 45 |PrError(|) == noE|
|00001a90| 72 72 29 20 7b 0d 09 09 | 09 09 09 53 65 74 50 6f |rr) {...|...SetPo|
|00001aa0| 72 74 28 26 74 68 65 50 | 4d 50 6f 72 74 2d 3e 67 |rt(&theP|MPort->g|
|00001ab0| 50 6f 72 74 29 3b 0d 09 | 09 09 09 09 0d 09 09 09 |Port);..|........|
|00001ac0| 09 09 4d 6f 76 65 54 6f | 28 31 30 30 2c 20 31 30 |..MoveTo|(100, 10|
|00001ad0| 30 29 3b 0d 09 09 09 09 | 09 44 72 61 77 53 74 72 |0);.....|.DrawStr|
|00001ae0| 69 6e 67 28 22 5c 70 54 | 68 69 73 20 69 73 20 61 |ing("\pT|his is a|
|00001af0| 20 74 65 73 74 2e 2e 2e | 22 29 3b 0d 09 09 09 09 | test...|");.....|
|00001b00| 7d 0d 09 09 09 09 50 72 | 43 6c 6f 73 65 50 61 67 |}.....Pr|ClosePag|
|00001b10| 65 28 74 68 65 50 4d 50 | 6f 72 74 29 3b 0d 09 09 |e(thePMP|ort);...|
|00001b20| 09 7d 0d 09 09 09 50 72 | 43 6c 6f 73 65 44 6f 63 |.}....Pr|CloseDoc|
|00001b30| 28 74 68 65 50 4d 50 6f | 72 74 29 3b 0d 09 09 09 |(thePMPo|rt);....|
|00001b40| 69 66 20 28 28 28 2a 74 | 68 65 50 72 69 6e 74 52 |if (((*t|hePrintR|
|00001b50| 65 63 6f 72 64 29 2d 3e | 70 72 4a 6f 62 2e 62 4a |ecord)->|prJob.bJ|
|00001b60| 44 6f 63 4c 6f 6f 70 20 | 3d 3d 20 62 53 70 6f 6f |DocLoop |== bSpoo|
|00001b70| 6c 4c 6f 6f 70 29 20 26 | 26 20 28 50 72 45 72 72 |lLoop) &|& (PrErr|
|00001b80| 6f 72 28 29 20 3d 3d 20 | 6e 6f 45 72 72 29 29 0d |or() == |noErr)).|
|00001b90| 09 09 09 09 50 72 50 69 | 63 46 69 6c 65 28 74 68 |....PrPi|cFile(th|
|00001ba0| 65 50 72 69 6e 74 52 65 | 63 6f 72 64 2c 20 4e 55 |ePrintRe|cord, NU|
|00001bb0| 4c 4c 2c 20 4e 55 4c 4c | 2c 20 4e 55 4c 4c 2c 20 |LL, NULL|, NULL, |
|00001bc0| 26 74 68 65 50 4d 53 74 | 61 74 75 73 29 3b 20 20 |&thePMSt|atus); |
|00001bd0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 0d 09 | | ..|
|00001be0| 09 7d 0d 09 7d 0d 09 74 | 68 65 45 72 72 6f 72 20 |.}..}..t|heError |
|00001bf0| 3d 20 50 72 45 72 72 6f | 72 28 29 3b 09 09 2f 2a |= PrErro|r();../*|
|00001c00| 20 41 6e 79 20 65 72 72 | 6f 72 73 3f 09 09 09 09 | Any err|ors?....|
|00001c10| 09 09 09 09 20 20 09 2a | 2f 0d 09 50 72 43 6c 6f |.... .*|/..PrClo|
|00001c20| 73 65 28 29 3b 09 09 09 | 09 09 2f 2a 20 43 6c 6f |se();...|../* Clo|
|00001c30| 73 65 20 74 68 65 20 50 | 72 69 6e 74 69 6e 67 20 |se the P|rinting |
|00001c40| 4d 61 6e 61 67 65 72 20 | 62 65 66 6f 72 65 20 61 |Manager |before a|
|00001c50| 74 74 65 6d 70 74 69 6e | 67 20 2a 2f 0d 09 09 09 |ttemptin|g */....|
|00001c60| 09 09 09 09 09 2f 2a 20 | 74 6f 20 72 65 70 6f 72 |...../* |to repor|
|00001c70| 74 20 74 68 65 20 65 72 | 72 6f 72 2e 09 09 09 09 |t the er|ror.....|
|00001c80| 09 09 20 09 2a 2f 0d 09 | 69 66 20 28 74 68 65 45 |.. .*/..|if (theE|
|00001c90| 72 72 6f 72 20 21 3d 20 | 6e 6f 45 72 72 29 09 09 |rror != |noErr)..|
|00001ca0| 2f 2a 20 49 66 20 74 68 | 65 72 65 20 77 61 73 20 |/* If th|ere was |
|00001cb0| 61 6e 20 65 72 72 6f 72 | 20 64 75 72 69 6e 67 20 |an error| during |
|00001cc0| 70 72 69 6e 74 69 6e 67 | 2e 2e 2e 09 20 09 2a 2f |printing|.... .*/|
|00001cd0| 0d 09 09 52 65 70 6f 72 | 74 45 72 72 6f 72 28 74 |...Repor|tError(t|
|00001ce0| 68 65 45 72 72 6f 72 29 | 3b 20 20 2f 2a 20 2e 2e |heError)|; /* ..|
|00001cf0| 2e 72 65 70 6f 72 74 20 | 74 68 65 20 65 72 72 6f |.report |the erro|
|00001d00| 72 20 74 6f 20 74 68 65 | 20 75 73 65 72 2e 09 09 |r to the| user...|
|00001d10| 09 20 09 2a 2f 0d 09 53 | 65 74 50 6f 72 74 28 63 |. .*/..S|etPort(c|
|00001d20| 75 72 72 65 6e 74 50 6f | 72 74 29 3b 0d 7d 0d 0d |urrentPo|rt);.}..|
|00001d30| 0d 6d 61 69 6e 28 29 0d | 7b 0d 09 49 6e 69 74 47 |.main().|{..InitG|
|00001d40| 72 61 66 28 26 71 64 2e | 74 68 65 50 6f 72 74 29 |raf(&qd.|thePort)|
|00001d50| 3b 0d 09 49 6e 69 74 46 | 6f 6e 74 73 28 29 3b 0d |;..InitF|onts();.|
|00001d60| 09 49 6e 69 74 57 69 6e | 64 6f 77 73 28 29 3b 0d |.InitWin|dows();.|
|00001d70| 09 49 6e 69 74 4d 65 6e | 75 73 28 29 3b 0d 09 54 |.InitMen|us();..T|
|00001d80| 45 49 6e 69 74 28 29 3b | 0d 09 49 6e 69 74 44 69 |EInit();|..InitDi|
|00001d90| 61 6c 6f 67 73 28 4e 55 | 4c 4c 29 3b 0d 09 49 6e |alogs(NU|LL);..In|
|00001da0| 69 74 43 75 72 73 6f 72 | 28 29 3b 0d 0d 09 2f 2a |itCursor|();.../*|
|00001db0| 20 47 65 74 20 74 68 65 | 20 49 44 20 6f 66 20 6f | Get the| ID of o|
|00001dc0| 75 72 20 72 65 73 6f 75 | 72 63 65 20 66 69 6c 65 |ur resou|rce file|
|00001dd0| 2e 20 20 53 69 6e 63 65 | 20 77 65 20 77 65 72 65 |. Since| we were|
|00001de0| 20 6a 75 73 74 20 6f 70 | 65 6e 65 64 2c 20 74 68 | just op|ened, th|
|00001df0| 65 20 43 75 72 52 65 73 | 46 69 6c 65 28 29 20 20 |e CurRes|File() |
|00001e00| 2a 2f 0d 09 2f 2a 20 77 | 69 6c 6c 20 62 65 20 6f |*/../* w|ill be o|
|00001e10| 75 72 73 2e 20 20 49 6e | 20 61 20 72 65 61 6c 20 |urs. In| a real |
|00001e20| 61 70 70 6c 69 63 61 74 | 69 6f 6e 2c 20 74 68 65 |applicat|ion, the|
|00001e30| 20 72 65 73 6f 75 72 63 | 65 20 66 69 6c 65 20 49 | resourc|e file I|
|00001e40| 44 20 77 6f 75 6c 64 20 | 62 65 20 74 68 65 20 49 |D would |be the I|
|00001e50| 44 20 20 20 2a 2f 0d 09 | 2f 2a 20 6f 66 20 79 6f |D */..|/* of yo|
|00001e60| 75 72 20 61 70 70 6c 69 | 63 61 74 69 6f 6e 27 73 |ur appli|cation's|
|00001e70| 20 64 6f 63 75 6d 65 6e | 74 20 66 69 6c 65 2e 09 | documen|t file..|
|00001e80| 09 09 09 09 09 09 09 09 | 09 20 09 2a 2f 0d 09 67 |........|. .*/..g|
|00001e90| 54 61 72 67 65 74 52 65 | 73 46 69 6c 65 20 3d 20 |TargetRe|sFile = |
|00001ea0| 43 75 72 52 65 73 46 69 | 6c 65 28 29 3b 0d 09 0d |CurResFi|le();...|
|00001eb0| 09 2f 2a 20 43 72 65 61 | 74 65 20 61 20 76 61 6c |./* Crea|te a val|
|00001ec0| 69 64 20 70 72 69 6e 74 | 20 72 65 63 6f 72 64 20 |id print| record |
|00001ed0| 09 09 09 09 09 09 09 09 | 09 09 09 09 09 2a 2f 0d |........|.....*/.|
|00001ee0| 09 67 50 72 69 6e 74 52 | 65 63 6f 72 64 48 64 6c |.gPrintR|ecordHdl|
|00001ef0| 20 3d 20 28 54 48 50 72 | 69 6e 74 29 4e 65 77 48 | = (THPr|int)NewH|
|00001f00| 61 6e 64 6c 65 28 73 69 | 7a 65 6f 66 28 54 50 72 |andle(si|zeof(TPr|
|00001f10| 69 6e 74 29 29 3b 0d 09 | 69 66 20 28 67 50 72 69 |int));..|if (gPri|
|00001f20| 6e 74 52 65 63 6f 72 64 | 48 64 6c 20 21 3d 20 4e |ntRecord|Hdl != N|
|00001f30| 55 4c 4c 29 20 7b 0d 09 | 09 2f 2a 20 4f 6b 61 79 |ULL) {..|./* Okay|
|00001f40| 2c 20 77 65 20 67 6f 74 | 20 61 20 70 72 69 6e 74 |, we got| a print|
|00001f50| 20 72 65 63 6f 72 64 2c | 20 6e 6f 77 20 69 6e 69 | record,| now ini|
|00001f60| 74 69 61 6c 69 7a 65 20 | 69 74 2e 09 09 20 20 09 |tialize |it... .|
|00001f70| 09 09 09 09 2a 2f 0d 09 | 09 49 6e 69 74 69 61 6c |....*/..|.Initial|
|00001f80| 69 7a 65 50 72 69 6e 74 | 52 65 63 6f 72 64 28 67 |izePrint|Record(g|
|00001f90| 50 72 69 6e 74 52 65 63 | 6f 72 64 48 64 6c 29 3b |PrintRec|ordHdl);|
|00001fa0| 0d 09 09 0d 09 09 2f 2a | 20 4e 6f 77 20 73 61 76 |....../*| Now sav|
|00001fb0| 65 20 74 68 65 20 70 72 | 69 6e 74 20 72 65 63 6f |e the pr|int reco|
|00001fc0| 72 64 20 69 6e 74 6f 20 | 74 68 65 20 72 65 73 6f |rd into |the reso|
|00001fd0| 75 72 63 65 20 66 69 6c | 65 2e 09 09 09 09 09 09 |urce fil|e.......|
|00001fe0| 2a 2f 0d 09 09 53 61 76 | 65 50 72 69 6e 74 52 65 |*/...Sav|ePrintRe|
|00001ff0| 63 6f 72 64 28 67 50 72 | 69 6e 74 52 65 63 6f 72 |cord(gPr|intRecor|
|00002000| 64 48 64 6c 2c 20 67 54 | 61 72 67 65 74 52 65 73 |dHdl, gT|argetRes|
|00002010| 46 69 6c 65 29 3b 0d 09 | 09 0d 09 09 2f 2a 20 4e |File);..|..../* N|
|00002020| 6f 77 20 74 68 61 74 20 | 69 74 27 73 20 73 61 76 |ow that |it's sav|
|00002030| 65 64 2c 20 6b 69 6c 6c | 20 69 74 20 6f 66 66 2e |ed, kill| it off.|
|00002040| 20 20 57 65 27 6c 6c 20 | 72 65 73 74 6f 72 65 20 | We'll |restore |
|00002050| 69 74 20 62 79 20 20 20 | 09 09 09 09 2a 2f 0d 09 |it by |....*/..|
|00002060| 09 2f 2a 20 63 61 6c 6c | 69 6e 67 20 47 65 74 50 |./* call|ing GetP|
|00002070| 72 69 6e 74 52 65 63 6f | 72 64 2e 09 09 09 09 09 |rintReco|rd......|
|00002080| 09 09 09 20 20 09 09 09 | 09 09 2a 2f 0d 09 09 44 |... ...|..*/...D|
|00002090| 69 73 70 6f 73 48 61 6e | 64 6c 65 28 28 48 61 6e |isposHan|dle((Han|
|000020a0| 64 6c 65 29 67 50 72 69 | 6e 74 52 65 63 6f 72 64 |dle)gPri|ntRecord|
|000020b0| 48 64 6c 29 3b 0d 09 09 | 67 50 72 69 6e 74 52 65 |Hdl);...|gPrintRe|
|000020c0| 63 6f 72 64 48 64 6c 20 | 3d 20 4e 55 4c 4c 3b 0d |cordHdl |= NULL;.|
|000020d0| 09 09 0d 09 09 2f 2a 20 | 4e 6f 77 20 67 65 74 20 |...../* |Now get |
|000020e0| 74 68 65 20 70 72 69 6e | 74 20 72 65 63 6f 72 64 |the prin|t record|
|000020f0| 20 66 72 6f 6d 20 74 68 | 65 20 66 69 6c 65 2e 20 | from th|e file. |
|00002100| 20 53 69 6e 63 65 20 74 | 68 65 09 20 20 20 09 09 | Since t|he. ..|
|00002110| 09 09 09 2a 2f 0d 09 09 | 2f 2a 20 72 65 63 6f 72 |...*/...|/* recor|
|00002120| 64 20 77 69 6c 6c 20 62 | 65 20 6c 6f 61 64 65 64 |d will b|e loaded|
|00002130| 20 61 73 20 61 20 72 65 | 73 6f 75 72 63 65 20 68 | as a re|source h|
|00002140| 61 6e 64 6c 65 20 61 6e | 79 77 61 79 2c 20 6c 65 |andle an|yway, le|
|00002150| 74 20 20 20 09 09 09 09 | 2a 2f 0d 09 09 2f 2a 20 |t ....|*/.../* |
|00002160| 47 65 74 50 72 69 6e 74 | 52 65 63 6f 72 64 20 61 |GetPrint|Record a|
|00002170| 6c 6c 6f 63 61 74 65 20 | 74 68 65 20 68 61 6e 64 |llocate |the hand|
|00002180| 6c 65 2e 09 09 09 09 09 | 20 20 09 09 09 09 09 2a |le......| .....*|
|00002190| 2f 0d 09 09 67 50 72 69 | 6e 74 52 65 63 6f 72 64 |/...gPri|ntRecord|
|000021a0| 48 64 6c 20 3d 20 47 65 | 74 50 72 69 6e 74 52 65 |Hdl = Ge|tPrintRe|
|000021b0| 63 6f 72 64 28 67 54 61 | 72 67 65 74 52 65 73 46 |cord(gTa|rgetResF|
|000021c0| 69 6c 65 29 3b 0d 09 09 | 69 66 20 28 67 50 72 69 |ile);...|if (gPri|
|000021d0| 6e 74 52 65 63 6f 72 64 | 48 64 6c 20 21 3d 20 4e |ntRecord|Hdl != N|
|000021e0| 55 4c 4c 29 20 7b 0d 09 | 09 09 2f 2a 20 4e 6f 77 |ULL) {..|../* Now|
|000021f0| 20 75 73 65 20 74 68 65 | 20 70 72 69 6e 74 20 72 | use the| print r|
|00002200| 65 63 6f 72 64 20 74 6f | 20 73 65 65 20 69 66 20 |ecord to| see if |
|00002210| 74 68 65 20 69 6e 66 6f | 72 6d 61 74 69 6f 6e 20 |the info|rmation |
|00002220| 77 65 09 09 09 09 2a 2f | 0d 09 09 09 2f 2a 20 73 |we....*/|..../* s|
|00002230| 61 76 65 64 20 77 61 73 | 20 70 72 65 73 65 72 76 |aved was| preserv|
|00002240| 65 64 2e 2e 2e 09 09 09 | 09 09 09 09 09 20 20 20 |ed......|..... |
|00002250| 09 09 09 09 2a 2f 0d 09 | 09 09 54 65 73 74 50 72 |....*/..|..TestPr|
|00002260| 69 6e 74 52 65 63 6f 72 | 64 28 67 50 72 69 6e 74 |intRecor|d(gPrint|
|00002270| 52 65 63 6f 72 64 48 64 | 6c 29 3b 0d 09 09 7d 20 |RecordHd|l);...} |
|00002280| 65 6c 73 65 0d 09 09 09 | 52 65 70 6f 72 74 45 72 |else....|ReportEr|
|00002290| 72 6f 72 28 4d 65 6d 45 | 72 72 6f 72 28 29 29 3b |ror(MemE|rror());|
|000022a0| 0d 09 7d 20 65 6c 73 65 | 0d 09 09 52 65 70 6f 72 |..} else|...Repor|
|000022b0| 74 45 72 72 6f 72 28 4d | 65 6d 45 72 72 6f 72 28 |tError(M|emError(|
|000022c0| 29 29 3b 0d 09 0d 09 2f | 2a 20 4b 69 6c 6c 20 74 |));..../|* Kill t|
|000022d0| 68 65 20 70 72 69 6e 74 | 20 72 65 63 6f 72 64 20 |he print| record |
|000022e0| 28 69 66 20 69 74 20 77 | 61 73 20 63 72 65 61 74 |(if it w|as creat|
|000022f0| 65 64 29 20 61 6e 64 20 | 67 6f 20 68 6f 6d 65 2e |ed) and |go home.|
|00002300| 2e 2e 20 09 09 09 09 09 | 2a 2f 0d 09 69 66 20 28 |.. .....|*/..if (|
|00002310| 67 50 72 69 6e 74 52 65 | 63 6f 72 64 48 64 6c 20 |gPrintRe|cordHdl |
|00002320| 21 3d 20 4e 55 4c 4c 29 | 0d 09 09 44 69 73 70 6f |!= NULL)|...Dispo|
|00002330| 73 48 61 6e 64 6c 65 28 | 28 48 61 6e 64 6c 65 29 |sHandle(|(Handle)|
|00002340| 67 50 72 69 6e 74 52 65 | 63 6f 72 64 48 64 6c 29 |gPrintRe|cordHdl)|
|00002350| 3b 0d 7d 0d 00 00 00 00 | 00 00 00 00 00 00 00 00 |;.}.....|........|
|00002360| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002370| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002380| 00 00 01 00 00 00 01 da | 00 00 00 da 00 00 00 3e |........|.......>|
|00002390| 3b 0d 20 20 20 20 45 4e | 44 20 45 4c 53 45 0d 20 |;. EN|D ELSE. |
|000023a0| 20 20 20 20 20 20 20 52 | 65 70 6f 72 74 45 72 72 | R|eportErr|
|000023b0| 08 50 52 53 61 76 65 2e | 63 00 02 00 00 00 54 45 |.PRSave.|c.....TE|
|000023c0| 58 54 4d 50 53 20 01 00 | 00 40 00 c0 00 00 00 00 |XTMPS ..|.@......|
|000023d0| 00 00 54 45 58 54 4d 50 | 53 20 01 00 00 40 00 c0 |..TEXTMP|S ...@..|
|000023e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000023f0| 00 00 a0 e9 05 8f 00 00 | 22 d4 00 00 02 18 65 2e |........|".....e.|
|00002400| 2e 2e 20 2a 29 0d 20 20 | 20 20 49 46 20 67 50 72 |.. *). | IF gPr|
|00002410| 69 6e 74 52 65 63 6f 72 | 64 48 64 6c 20 3c 3e 20 |intRecor|dHdl <> |
|00002420| 4e 49 4c 20 54 48 45 4e | 0d 20 20 20 20 20 20 20 |NIL THEN|. |
|00002430| 20 44 69 73 70 6f 73 48 | 61 6e 64 6c 65 28 48 61 | DisposH|andle(Ha|
|00002440| 6e 64 6c 65 28 67 50 72 | 69 6e 74 52 65 63 6f 72 |ndle(gPr|intRecor|
|00002450| 64 48 64 6c 29 29 3b 0d | 45 4e 44 2e 0d 20 20 20 |dHdl));.|END.. |
|00002460| 20 49 46 20 67 50 72 69 | 6e 74 52 65 63 6f 72 64 | IF gPri|ntRecord|
|00002470| 48 64 6c 20 3c 3e 20 4e | 49 4c 20 54 48 45 4e 0d |Hdl <> N|IL THEN.|
|00002480| 00 00 00 48 00 09 4d 6f | 6e 61 63 6f 00 22 00 0f |...H..Mo|naco."..|
|00002490| 00 00 00 14 00 01 3a 74 | 00 0a 01 2c 00 0f 01 37 |......:t|...,...7|
|000024a0| 00 22 00 00 00 00 00 06 | 00 04 00 2a 00 03 01 d8 |."......|...*....|
|000024b0| 02 29 00 2a 00 03 01 d8 | 02 29 a1 a8 a0 6d 00 00 |.).*....|.)...m..|
|000024c0| 05 48 00 00 05 48 00 00 | 03 de 01 00 00 00 00 8a |.H...H..|........|
|000024d0| 00 06 00 00 07 8c 00 00 | 07 97 0b 52 65 70 6f 72 |........|...Repor|
|000024e0| 74 45 72 72 6f 72 00 00 | 09 c1 00 00 09 d6 15 49 |tError..|.......I|
|000024f0| 6e 69 74 69 61 6c 69 7a | 65 50 72 69 6e 74 52 65 |nitializ|ePrintRe|
|00002500| 63 6f 72 64 00 00 0c 1a | 00 00 0c 29 0f 53 61 76 |cord....|...).Sav|
|00002510| 65 50 72 69 6e 74 52 65 | 63 6f 72 64 00 00 14 50 |ePrintRe|cord...P|
|00002520| 00 00 14 5e 0f 47 65 74 | 50 72 69 6e 74 52 65 63 |...^.Get|PrintRec|
|00002530| 6f 72 64 00 00 00 17 71 | 00 00 17 80 0f 54 65 73 |ord....q|.....Tes|
|00002540| 74 50 72 69 6e 74 52 65 | 63 6f 72 64 00 00 1c b1 |tPrintRe|cord....|
|00002550| 00 00 1c b5 05 6d 61 69 | 6e 00 00 00 01 00 00 00 |.....mai|n.......|
|00002560| 01 da 00 00 00 da 00 00 | 00 3e 00 35 f6 78 02 94 |........|.>.5.x..|
|00002570| 00 00 00 1c 00 3e 00 00 | 4d 50 53 52 00 01 00 0a |.....>..|MPSR....|
|00002580| 03 ed ff ff 00 00 00 00 | 00 00 00 00 03 ef ff ff |........|........|
|00002590| 00 00 00 4c 00 37 2e 98 | 00 00 00 00 00 00 00 00 |...L.7..|........|
|000025a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000025b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000025c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000025d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000025e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000025f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
+--------+-------------------------+-------------------------+--------+--------+